const webpack=require('webpack');
const ExtractTextPlugin=require("extract-text-webpack-plugin")
const pluginHtml=require('./HtmlWebpackPlugin');
const conf=require('../../conf.js');
const loaderOptionsPlugin=require('./loaderOptionsPlugin')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

var output=conf.output;
var basePlugins=require('./basePlugins');


var a;
if(process.env.NODE_ENV=='dev'){
	a=[new webpack.HotModuleReplacementPlugin(),new BundleAnalyzerPlugin()].concat(pluginHtml).concat(basePlugins).concat(loaderOptionsPlugin)
}else if(process.env.NODE_ENV=='pack'){
	a=[new ExtractTextPlugin({
			filename:output.css+'/[name].css',
			allChunks: true
		})].concat(pluginHtml).concat(basePlugins).concat(loaderOptionsPlugin)
}
module.exports=a;